var layerIndex = 0;
var golbe_input_pic_id = '';
function upyunPicUpload(input_pic_id,uploadUrl) {
	//console.log(document.body.clientWidth+"---"+document.body.clientHeight);
	golbe_input_pic_id =input_pic_id
	layerIndex = layer.open({
		type : 2,
		area : [ '100%', '100%' ],
		fix : true,
		title : '上传图片',
		content : uploadUrl
	});
}

function viewImg(input_pic_id) {
	var path = $("#"+input_pic_id).val();
	if (!path || path == "") {
		layer.alert("无图片预览!", {
			icon : 0
		});
		return;
	}
	layer.open({
		type : 1,
		area : [ '500px', '500px' ],
		title : false,
		skin : 'layui-layer-nobg',
		shadeClose : true,
		content : '<p style="text-align: center;"><img src="' + path
				+ '" alt="无法显示图片" style="width:100%;height:100%;" /></p>'
	});
}

// 关闭弹出框并给地址栏传值
function closeWin(url) {
	if (null == url) {
		layer.msg("上传失败，请重新上传", {
			shade : [ 0.8, '#393D49' ]
		});
		layer.close(layerIndex);
		return;
	}
	layer.msg("上传成功", {
		shade : [ 0.8, '#393D49' ]
	});
	layer.close(layerIndex);
	$("#"+golbe_input_pic_id).val(url);
}